home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-05-15 | 1.9 KB | 51 lines | [TEXT/ToyS] |
- -- Rewrite PS
- -- © David van Driessche - May 97 - EnFocus Software NV
- ----------------------------------------------------------------------------------------------------------------------
-
- -- OPEN will replace the following four variables with information about the current job
- -- when this script is played.
- set fullPath to "file_path" -- the full path to the file, e.g. "HD:Jobs:Job 1:file.ps"
- set jobName to "job_name" -- the name of the file to be processed, e.g. "file.ps"
- set jobParentPath to "jobParent_path" -- the path to the file's parent folder, e.g. "HD:Jobs:Job 1:"
- set jobParams to "job_params" -- record containing the preference file and user parameter string, if specified
-
- tell application "Tailor"
-
- -- Disable Tailor's user interface to do batch processing. In this mode only the
- -- Progress Inspector will pop up to inform you.
- set userinterface to false
-
- -- Activate Tailor
- activate
-
- -- Open the document with a timeout only after one hour
- -- This is necessary to open big documents without getting an AppleScript timeout
- with timeout of 3600 seconds
- open alias fullPath
- end timeout
-
- -- Create a new name for the document we just opened
- set newName to fullPath & ".t"
-
- -- Get a reference to that document, the document we just opened will be current. This avoids
- -- having to address the document by name or number (which could be ambigious).
- set doc to currentdocument
-
- -- Save the document with the new name
- save doc in file newName as PS
-
- -- And close the document without saving
- close doc saving no
-
- -- Don't forget to re-enable the user interface
- set userinterface to true
-
- end tell
-
- -- The script must return one of the following:
- -- • reference to file filepath - the file to move to the next task in the pipeline
- -- • "Error Message" - error string to be displayed in the OPEN message log
- -- • nothing - OPEN moves the original file to the next task in the pipline
-
- return a reference to (file newName)
-